home *** CD-ROM | disk | FTP | other *** search
- on makemovablerb theworld, hvk, modelname, omosa, atari, hanpatsu, masatsu
- theworld.model(modelname).addModifier(#meshDeform)
- therigidbody = hvk.makemovablerigidbody(modelname, omosa, atari)
- therigidbody.restitution = hanpatsu
- therigidbody.friction = masatsu
- end
-
- on makefixedrb theworld, hvk, modelname, atari, hanpatsu, masatsu
- theworld.model(modelname).addModifier(#meshDeform)
- therigidbody = hvk.makefixedrigidbody(modelname, atari)
- therigidbody.restitution = hanpatsu
- therigidbody.friction = masatsu
- end
-
- on makeangulardp hvk, modelname, dpkaiten, str, damp
- newdp = hvk.makeangulardashpot(modelname, modelname)
- newdp.rotation = dpkaiten
- newdp.strength = str
- newdp.damping = damp
- end
-
- on getcurrentfwd theworld, modelname, modeltransform
- modeltransform.position = vector(0, 0, 0)
- modeltransform.scale = vector(1, 1, 1)
- currentfwd = modeltransform * vector(0, 1, 0)
- return currentfwd
- end
-
- on getcurrentspeed theworld, hvk, modelname, modeltransform
- currentfwd = getcurrentfwd(theworld, modelname, modeltransform)
- currentVel = hvk.rigidbody(modelname).linearvelocity
- currentSpeed = currentVel.dot(currentfwd)
- return currentSpeed
- end
-
- on getdegree x1, y1, x2, y2
- res = atan(abs(y1 - y2) / (abs(x1 - x2) + 0.0001)) * 180 / PI
- res = (res * ((x2 >= x1) and (y2 < y1))) + ((180 - res) * ((x2 < x1) and (y2 < y1))) + ((180 + res) * ((x2 < x1) and (y2 >= y1))) + ((360 - res) * ((x2 >= x1) and (y2 >= y1)))
- return res
- end
-
- on putkeycode
- put the keyCode
- end
-
- on spritespace thesprite, theworld, camnumber
- thevec = thesprite.camera(camnumber).spriteSpaceToWorldSpace(the mouseLoc)
- theworld.model("cusor").transform.position = thevec * -0.14999999999999999 * 1.28499999999999992
- theworld.model("cusor").transform.position.x = -theworld.model("cusor").transform.position.x
- theworld.model("cusor").transform.position.y = -theworld.model("cusor").transform.position.y
- end
-
- on setlossplayer2d theworld, player
- playerList = ["player1", "player2", "cpu1", "cpu2", "cpu3"]
- deleteOne(playerList, player)
- theworld.model("2D_" & player & "Lost_B").transform.position = vector(0, -50, 0)
- repeat with a = 1 to 4
- theworld.model("2D_" & playerList[a] & "Lost_B").transform.position = vector(0, 0, -300)
- end repeat
- timeout("Loss2Dtimer").new(2000, #loss2dtimeout)
- end
-
- on loss2dtimeout
- member("stage").model("2D_player1Lost_B").transform.position = vector(0, 0, -300)
- member("stage").model("2D_player2Lost_B").transform.position = vector(0, 0, -300)
- member("stage").model("2D_cpu1Lost_B").transform.position = vector(0, 0, -300)
- member("stage").model("2D_cpu2Lost_B").transform.position = vector(0, 0, -300)
- member("stage").model("2D_cpu3Lost_B").transform.position = vector(0, 0, -300)
- timeout("Loss2Dtimer").forget()
- end
-
- on setuvlist
- uv_list = [#uv2d_0: [[0.125, 0.745], [0.25, 0.505], [0.25, 0.745], [0.125, 0.505]], #uv2d_1: [[0.01, 0.98999999999999999], [0.1196, 0.76000000000000001], [0.1196, 0.98999999999999999], [0.01, 0.76000000000000001]], #uv2d_2: [[0.13, 0.98999999999999999], [0.25, 0.76000000000000001], [0.25, 0.98999999999999999], [0.13, 0.76000000000000001]], #uv2d_3: [[0.25, 0.98999999999999999], [0.37, 0.76000000000000001], [0.37, 0.98999999999999999], [0.25, 0.76000000000000001]], #uv2d_4: [[0.38, 0.98999999999999999], [0.5, 0.76000000000000001], [0.5, 0.98999999999999999], [0.38, 0.76000000000000001]], #uv2d_5: [[0.5, 0.98999999999999999], [0.625, 0.76000000000000001], [0.625, 0.98999999999999999], [0.5, 0.76000000000000001]], #uv2d_6: [[0.625, 0.98999999999999999], [0.75, 0.76000000000000001], [0.75, 0.98999999999999999], [0.625, 0.76000000000000001]], #uv2d_7: [[0.755, 0.98999999999999999], [0.87, 0.76000000000000001], [0.87, 0.98999999999999999], [0.755, 0.76000000000000001]], #uv2d_8: [[0.88, 0.98999999999999999], [0.997, 0.76000000000000001], [0.997, 0.98999999999999999], [0.88, 0.76000000000000001]], #uv2d_9: [[0.01, 0.745], [0.1196, 0.505], [0.1196, 0.745], [0.01, 0.505]], #uv2d_yellow: [[0.5, 0.0], [0.5, 0.125], [0.0, 0.0], [0.0, 0.125]], #uv2d_red: [[0.5, 0.125], [0.5, 0.25], [0.0, 0.125], [0.0, 0.25]], #uv2d_blue: [[0.995, 0.125], [0.995, 0.25], [0.505, 0.125], [0.505, 0.25]], #uv2d_green: [[0.995, 0.0], [0.995, 0.125], [0.505, 0.0], [0.505, 0.125]], #uv2d_player1: [[0.995, 0.5], [0.995, 0.625], [0.505, 0.5], [0.505, 0.625]], #uv2d_player2: [[0.0, 0.5], [0.0, 0.38], [0.5, 0.38], [0.5, 0.5]], #uv2d_cpu1: [[0.505, 0.5], [0.505, 0.38], [0.995, 0.38], [0.995, 0.5]], #uv2d_cpu2: [[0.005, 0.38], [0.005, 0.25], [0.505, 0.25], [0.505, 0.38]], #uv2d_cpu3: [[0.505, 0.38], [0.505, 0.25], [0.995, 0.25], [0.995, 0.38]], #uv2d_lost: [[0.995, 0.625], [0.995, 0.75], [0.505, 0.625], [0.505, 0.75]], #uv2d_time: [[0.5, 0.57140000000000002], [0.5, 0.68379999999999996], [0.25, 0.68379999999999996], [0.25, 0.57140000000000002]], #uv2d_1st: [[0.25, 0.38500000000000001], [0.25, 0.48999999999999999], [0.0, 0.38500000000000001], [0.0, 0.48999999999999999]], #uv2d_2nd: [[0.5, 0.38500000000000001], [0.5, 0.48999999999999999], [0.25, 0.38500000000000001], [0.25, 0.48999999999999999]], #uv2d_3rd: [[0.75, 0.38500000000000001], [0.75, 0.48999999999999999], [0.5, 0.38500000000000001], [0.5, 0.48999999999999999]], #uv2d_4th: [[1.0, 0.38500000000000001], [1.0, 0.48999999999999999], [0.75, 0.38500000000000001], [0.75, 0.48999999999999999]]]
- return uv_list
- end
-